<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="TareaCreateDlg" widgetVar="TareaCreateDialog" modal="true" resizable="false" appendTo="@(body)" header="#{bundle.CreateTareaTitle}">
            <h:form id="TareaCreateForm">
                <h:panelGroup id="display">
                    <p:panelGrid columns="2" rendered="#{tareaController.selected != null}">
                        <p:outputLabel value="#{bundle.CreateTareaLabel_idtarea}" for="idtarea" />
                        <p:inputText id="idtarea" value="#{tareaController.selected.idtarea}" title="#{bundle.CreateTareaTitle_idtarea}" required="true" requiredMessage="#{bundle.CreateTareaRequiredMessage_idtarea}"/>
                        <p:outputLabel value="#{bundle.CreateTareaLabel_descripcion}" for="descripcion" />
                        <p:inputText id="descripcion" value="#{tareaController.selected.descripcion}" title="#{bundle.CreateTareaTitle_descripcion}" required="true" requiredMessage="#{bundle.CreateTareaRequiredMessage_descripcion}"/>
                        <p:outputLabel value="#{bundle.CreateTareaLabel_duracion}" for="duracion" />
                        <p:inputText id="duracion" value="#{tareaController.selected.duracion}" title="#{bundle.CreateTareaTitle_duracion}" required="true" requiredMessage="#{bundle.CreateTareaRequiredMessage_duracion}"/>
                        <p:outputLabel value="#{bundle.CreateTareaLabel_FInicio}" for="FInicio" />
                        <p:calendar id="FInicio" pattern="MM/dd/yyyy" value="#{tareaController.selected.FInicio}" title="#{bundle.EditTareaTitle_FInicio}"  showOn="button"/>
                        <p:outputLabel value="#{bundle.CreateTareaLabel_FFin}" for="FFin" />
                        <p:calendar id="FFin" pattern="MM/dd/yyyy" value="#{tareaController.selected.FFin}" title="#{bundle.EditTareaTitle_FFin}"  showOn="button"/>
                        <p:outputLabel value="#{bundle.CreateTareaLabel_responsable}" for="responsable" />
                        <p:inputText id="responsable" value="#{tareaController.selected.responsable}" title="#{bundle.CreateTareaTitle_responsable}" />
                        <p:outputLabel value="#{bundle.CreateTareaLabel_itemsControl}" for="itemsControl" />
                        <p:inputText id="itemsControl" value="#{tareaController.selected.itemsControl}" title="#{bundle.CreateTareaTitle_itemsControl}" />
                        <p:outputLabel value="#{bundle.CreateTareaLabel_objetivoEstrategicoIdobjetivoEstrategico}" for="objetivoEstrategicoIdobjetivoEstrategico" />
                        <p:selectOneMenu id="objetivoEstrategicoIdobjetivoEstrategico" value="#{tareaController.selected.objetivoEstrategicoIdobjetivoEstrategico}" required="true" requiredMessage="#{bundle.EditTareaRequiredMessage_objetivoEstrategicoIdobjetivoEstrategico}">
                            <f:selectItems value="#{objetivoEstrategicoController.itemsAvailableSelectOne}"
                                           var="objetivoEstrategicoIdobjetivoEstrategicoItem"
                                           itemValue="#{objetivoEstrategicoIdobjetivoEstrategicoItem}"
                                           itemLabel="#{objetivoEstrategicoIdobjetivoEstrategicoItem.definicion}"/>
                        </p:selectOneMenu>
                       
                    </p:panelGrid>
                    <p:commandButton actionListener="#{tareaController.create}" value="#{bundle.Save}" update="display,:TareaListForm:datalist,:growl" oncomplete="handleSubmit(args,'TareaCreateDialog');"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="TareaCreateDialog.hide()"/>
                </h:panelGroup>
            </h:form>
        </p:dialog>

    </ui:composition>
</html>
